//
//  WPStringHandle.m
//  ZhongChouPingTai
//
//  Created by WeiPan on 16/4/11.
//  Copyright © 2016年 WPJoe. All rights reserved.
//

#import "WPCalculateRectHandle.h"

@implementation WPCalculateRectHandle
#pragma mark - 计算文本高度
+ (CGRect) calculateSizeWithFont:(NSInteger)Font Text:(NSString *)text Width:(CGFloat) width {
    NSDictionary *attr = @{NSFontAttributeName : [UIFont systemFontOfSize:Font]};
    CGRect size = [text boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin attributes:attr context:nil];
    return size;
}
+ (CGRect)calculateSizeWithFont:(NSInteger)Font Text:(NSString *)text height:(CGFloat)height {
    NSDictionary *attr = @{NSFontAttributeName : [UIFont systemFontOfSize:Font]};
    CGRect size = [text boundingRectWithSize:CGSizeMake(MAXFLOAT, height) options:NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin attributes:attr context:nil];
    return size;
}
@end
